#ifndef __PORT_BOS_H__
#define __PORT_BOS_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct {
  int type;
  uint8_t *msg;
  uint16_t msg_len;
  void (*release)(void *p);
} bMsgInfo_t;

typedef struct {
  uint32_t size;
  uint32_t crc32;
  char filename[64];
} bMsgFwinfo_t;

typedef struct {
  uint32_t offset;
  uint32_t size;
} bMsgFwReqData_t;

typedef struct {
  uint32_t offset;
  uint32_t size;
  uint8_t *pdata;
} bMsgFwData_t;

#define MSG_TYPE_VOICE_VOLUME 0x1
#define MSG_TYPE_VOICE_SWITCH 0x2
#define MSG_TYPE_VOICE_STATE 0x3
#define MSG_TYPE_VOICE_TTS 0x4
#define MSG_TYPE_TSL_INVOKE 0x5
#define MSG_TYPE_CFGNET_MODE 0x6
#define MSG_TYPE_DEVICE_INFO 0x7
#define MSG_TYPE_NOTIFY_OTA 0x8
#define MSG_TYPE_REQ_OTA_DATA 0x9
#define MSG_TYPE_NOTIFY_OTA_DATA 0xA

void bBabyOSRun(void *);
void bBabyOSSendMsg(int type, uint8_t *pmsg, uint16_t msg_len,
                    void (*release)(void *));

#ifdef __cplusplus
}
#endif

#endif /* __PORT_BOS_H__ */
